ManifestReader.Resources Property

Return a list of resources contained in the package. The dictionary has the resource id as the key, the ResourceNodeReader as the value.

Parent Type: ManifestReader

Namespace: Microsoft.LearningComponents.Manifest

Assembly: Microsoft.LearningComponents.dll

Syntax
C#

public IDictionary<string,ResourceNodeReader> Resources

{ get; }
Exceptions
Exception type Condition
InvalidPackageException

There are multiple <resources> nodes and ManifestReaderSettings.FixScormRequirementViolations=false is set.

Remarks

In a SCORM package, the ids of each element must be unique. If the manifest being read violates this requirement and ManifestReaderSettings.FixScormRequirementViolations=false is set, the collection of resources will throw an InvalidPackageException when the error is encountered. If ManifestReaderSettings.FixScormRequirementViolations=true is set, only the first resource of a duplicated ID will be contained in the list.

SCORM states there must be resources in a valid manifest. However, this method simply returns an empty dictionary in this case. It is up to the application to determine what to do if this happens.

Example

Loop through the resources in the manifest.

C#
    foreach(ResourceNodeReader resource in manifest.Resources.Values)
    {
        // use the resource
    }